<?php 
require_once '../includes/funciones.php';
include ("seguridad.php");
conexion();
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title><?php titulopanel(); ?></title>
<link rel="STYLESHEET" type="text/css" href="estilo.css"><link rel="shortcut icon" href="favicon.ico" />
<!-- Editor TinyMce -->
<script type="text/javascript" src="../plugins/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
    mode : 'exact',
    theme : 'advanced',
	elements: 'description',
    theme_advanced_buttons1 : 'bold,italic,underline,undo,redo',
    theme_advanced_buttons2 : '',
    theme_advanced_buttons3 : '',
    theme_advanced_toolbar_location : 'top',
    theme_advanced_toolbar_align : 'left',    
    init_instance_callback : "initialiseInstance"
});

$(document).ready(function() {
$("input[type='submit']").click(function() {
tinyMCE.triggerSave();
})
})
	
</script>

</head>
<body>

<div id="contenedor">

  <div id="encabezado"><?php include('header.php') ?></div><!--fin de encabezado-->

  <div id="menuizquierda"><?php include('menu.php') ?></div>	<!--fin de menuizquierda-->

  <div id="content">
      
      <div id="formulario">

        <br>
	<?php

        if(isset($_GET['var']))
        {
            $var=sqlint($_GET['var']);
    
            $result=mysql_query("select * from events where id=$var");

        if(mysql_num_rows($result) !=0)
        {
            while($row=mysql_fetch_array($result))
            {
		$impresos++; //me va aumentando por cada uno asi despues puedo usar para la PAGINACION

		$id_events=$row['id'];
                $date=cambiarFechaMostrar($row['date']);
		$title=cleanxss($row['title']);
		$description=cleanxss($row['description']);
                $published=$row['is_published'];
            }
            mysql_free_result($result);
        }
        else 
        {
            $_SESSION["errorborrarevento"]="noexiste";
            header	("location: eventos.php");
        }
		
        ?>

      <span class="title">Eliminar Evento</span>		
        <br><br>
			
	<form class="admin" action="control_eventos.php" method="post">
            <fieldset class="admin">
		<legend>Evento</legend>
		<p><span>Publicar:</span>
		<?php 
		if($published==1)
                {
                    echo '<input type="checkbox" name="published" value="1" checked /></input>';
		}
                else
                {
                    echo '<input type="checkbox" name="published" value="1" /></input>';		
		}
		?>
		</p>
                <br>
                
                <p><span>Fecha:</span>
                    <input type="text" name="date" value="<?php echo $date?>">
                </p>
                <br>
                    
                <p><span>T&iacute;tulo:</span>
                    <input type="text" name="title" id="title" onkeyup="if (this.value.length == 139) this.disabled = true;" size="70px" value="<?php echo $title?>">
		</p>
		<br>  
			
                <p><span>Descripci&oacute;n:</span>
                    <textarea name="description" id="description"  cols="60" rows="4"><?php echo limpiar_parr($description)?></textarea>
                    <input name="boton" type="hidden" id="boton" value="3"></input>
                    <input name="id_events" type="hidden" id="boton" value="<?php echo $id_events?>"></input>
                    <br>
		</p>
		<br>
		</fieldset>
            
                <br>
		<input type="submit" class="buttonadmin" value="Borrar">
		<a class="enlacecancelar" href="noticias.php"><input type="button" class="buttoncancelar" value="Cancelar"></a>		
	</form>
	<br><br>

<?php 
} #Cierra el IF del isset($_GET['var'])

?>
</div><!-- formulario -->

</div><!--content-->


<div id="piepagina"></div> <!--fin de piepagina-->

</div><!-- contenedor -->

</body>

</html>
